home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / pcb-1.000 / pcb-1 / pcb-1.3 / const.h < prev    next >
C/C++ Source or Header  |  1995-02-26  |  6KB  |  173 lines

  1. /*
  2.  *                            COPYRIGHT
  3.  *
  4.  *  PCB, interactive printed circuit board design
  5.  *  Copyright (C) 1994,1995 Thomas Nau
  6.  *
  7.  *  This program is free software; you can redistribute it and/or modify
  8.  *  it under the terms of the GNU General Public License as published by
  9.  *  the Free Software Foundation; either version 2 of the License, or
  10.  *  (at your option) any later version.
  11.  *
  12.  *  This program is distributed in the hope that it will be useful,
  13.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  *  GNU General Public License for more details.
  16.  *
  17.  *  You should have received a copy of the GNU General Public License
  18.  *  along with this program; if not, write to the Free Software
  19.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  *
  21.  *  Contact addresses for paper mail and Email:
  22.  *  Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
  23.  *  Thomas.Nau@rz.uni-ulm.de
  24.  *
  25.  *  RCS: $Header: /sda4/users/nau/src/pcb/RCS/const.h,v 2.3 1994/10/29 17:30:51 nau Exp nau $
  26.  */
  27.  
  28. /* global constants
  29.  */
  30.  
  31. #ifndef    __CONST_INCLUDED__
  32. #define    __CONST_INCLUDED__
  33.  
  34. #include <limits.h>
  35. #include <X11/cursorfont.h>
  36.  
  37. /* ---------------------------------------------------------------------------
  38.  * some file-, directory- and environment names
  39.  */
  40. #define    FONTFILENAME        "default_font"
  41. #define    EMERGENCY_NAME        "/tmp/PCB.%i.save"        /* %i --> pid */
  42. #define    BACKUP_NAME            "/tmp/PCB.%i.backup"    /* %i --> pid */
  43.  
  44. /* ---------------------------------------------------------------------------
  45.  * the default X cursor shape for the output window
  46.  */
  47. #define    DEFAULT_CURSORSHAPE        XC_crosshair
  48.  
  49. /* ---------------------------------------------------------------------------
  50.  * some limit specifications
  51.  */
  52. #define    MAX_LAYER                8    /* max number of layer, check source */
  53.                                     /* code for more changes */
  54. #define    MIN_LINESIZE            1    /* thickness of lines in 1/1000'' */
  55. #define    MAX_LINESIZE            250
  56. #define    MIN_TEXTSCALE            20    /* scaling of text objects in percent */
  57. #define    MAX_TEXTSCALE            1000
  58. #define    MIN_PINORVIASIZE        30    /* size of a pin or via in */
  59. #define    MIN_PINORVIAHOLE        10    /* size of a pins or vias drilling hole */
  60. #define    MAX_PINORVIASIZE        250
  61. #define    MIN_PINORVIACOPPER        20    /* min difference outer-inner diameter */
  62. #define    MIN_GRID                1    /* grid in 1/1000'' */
  63. #define    MAX_GRID                200
  64. #define    MIN_ZOOM                0    /* min zoom (shift operations) */
  65. #define    MAX_ZOOM                4    /* max zoom (shift operations) */
  66. #define    MAX_FONTPOSITION        127    /* upper limit of characters in my font */
  67.  
  68. #define    MAX_COORD                20000    /* coordinate limits */
  69. #define    MIN_SIZE                3000/* lowest widht and height */
  70. #define    MAX_BUFFER                5    /* number of pastebuffers */
  71.                                     /* additional changes in menu.c are */
  72.                                     /* also required to select more buffers */
  73.  
  74. #define    DEFAULT_DRILLINGHOLE    40    /* default inner/outer ratio for */
  75.                                     /* pins/vias in percent */
  76.  
  77. #if MAX_LINESIZE > MAX_PINORVIASIZE    /* maximum size value */
  78. #define    MAX_SIZE    MAX_LINESIZE
  79. #else
  80. #define    MAX_SIZE    MAX_PINORVIASIZE
  81. #endif
  82.  
  83. #ifndef    MAXPATHLEN                    /* maximum path length */
  84. #ifdef    PATH_MAX
  85. #define    MAXPATHLEN    PATH_MAX
  86. #else
  87. #define    MAXPATHLEN    2048
  88. #endif
  89. #endif
  90.  
  91. #define    MAX_SEARCH_POINT_DISTANCE    15    /* maximum distance when searching */
  92.                                         /* polygon points */
  93.  
  94. /* ---------------------------------------------------------------------------
  95.  * modes
  96.  */
  97. #define    NO_MODE                    0    /* no mode selected */
  98. #define    VIA_MODE                1    /* draw vias */
  99. #define    LINE_MODE                2    /* draw lines */
  100. #define    RECTANGLE_MODE            3    /* create rectangles */
  101. #define    POLYGON_MODE            4    /* draw filled polygons */
  102. #define    PASTEBUFFER_MODE        5    /* paste objects from buffer */
  103. #define    TEXT_MODE                6    /* create text objects */
  104. #define    MIRROR_MODE                101    /* move objects */
  105. #define    ROTATE_MODE                102    /* rotate objects */
  106. #define    REMOVE_MODE                103    /* remove objects */
  107. #define    MOVE_MODE                104    /* move objects */
  108. #define    COPY_MODE                105    /* copy objects */
  109.  
  110. /* ---------------------------------------------------------------------------
  111.  * misc constants
  112.  */
  113. #define    DEFAULT_SIZE            "7000x5000"    /* default layout size (EURO) */
  114. #define    DEFAULT_MEDIASIZE        "a4"        /* default output media */
  115. #define    DEFAULT_CELLSIZE        50            /* default cell size for symbols */
  116. #define    MARK_SIZE                50            /* size of a mark for elements */
  117. #define    MIN_GRID_DISTANCE        4            /* minimum distance between point */
  118.                                             /* to enable grid drawing */
  119.  
  120. /* ---------------------------------------------------------------------------
  121.  * object flags
  122.  */
  123. #define    OBJ_FLAGS        0x4f        /* all used flags */
  124. #define    NOFLAG            0x00
  125. #define    PINFLAG            0x01        /* is a pin */
  126. #define    VIAFLAG            0x02        /* is a via */
  127. #define    FOUNDFLAG        0x04        /* was used by 'FindConnection()' */
  128. #define    MIRRORFLAG        0x08        /* use mirroring for text */
  129. #define    SELECTEDFLAG    0x40        /* object has been selected */
  130.  
  131. /* ---------------------------------------------------------------------------
  132.  * PCB flags
  133.  */
  134. #define    PCB_FLAGS            0x01a0        /* all used flags */
  135. #define    CANONICALFLAG        0x0020        /* display canonical element names */
  136. #define    ABSOLUTEFLAG        0x0080        /* grid is relative to (0,0) */
  137. #define    ALLDIRCETIONFLAG    0x0100        /* enable 'all-direction' lines */
  138.  
  139. /* ---------------------------------------------------------------------------
  140.  * define some standard layouts for childs of a form widget
  141.  */
  142. #define    LAYOUT_TOP        XtNleft, XtChainLeft,    \
  143.                         XtNright, XtChainLeft,    \
  144.                         XtNtop, XtChainTop,        \
  145.                         XtNbottom, XtChainTop
  146. #define    LAYOUT_BOTTOM    XtNleft, XtChainLeft,    \
  147.                         XtNright, XtChainLeft,    \
  148.                         XtNtop, XtChainBottom,    \
  149.                         XtNbottom, XtChainBottom
  150. #define    LAYOUT_NORMAL    XtNleft, XtChainLeft,    \
  151.                         XtNright, XtChainRight,    \
  152.                         XtNtop, XtChainTop,        \
  153.                         XtNbottom, XtChainBottom
  154.  
  155. /* ---------------------------------------------------------------------------
  156.  * object types
  157.  */
  158. #define    NO_TYPE                    0x0000        /* no object */
  159. #define    VIA_TYPE                0x0001
  160. #define    ELEMENT_TYPE            0x0002
  161. #define    LINE_TYPE                0x0004
  162. #define    POLYGON_TYPE            0x0008
  163. #define    TEXT_TYPE                0x0010
  164.  
  165. #define    PIN_TYPE                0x1000        /* objects that are part */
  166. #define    ELEMENTNAME_TYPE        0x2000        /* of others */
  167. #define    POLYGONPOINT_TYPE        0x4000
  168.  
  169. #define    ALL_OBJECTS                0x0fff        /* all single objects */
  170. #define    ALL_TYPES                -1            /* all bits set */
  171.  
  172. #endif
  173.